# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kdenlive
pkgver=23.08.4
pkgrel=0
# ppc64le mlt uses 64bit long double while libgcc uses 128bit long double
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine -> purpose
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://kdenlive.org"
pkgdesc="An intuitive and powerful multi-track video editor, including most recent video technologies"
license="GPL-2.0-or-later"
depends="
	ffmpeg
	frei0r-plugins
	qt5-qtquickcontrols
	"
makedepends="
	extra-cmake-modules
	kdeclarative5-dev
	kdoctools5-dev
	kfilemetadata5-dev
	knewstuff5-dev
	knotifyconfig5-dev
	kxmlgui5-dev
	mlt-dev
	purpose5-dev
	qt5-qtbase-dev
	qt5-qtmultimedia-dev
	qt5-qtnetworkauth-dev
	qt5-qtsvg-dev
	rttr-dev
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/multimedia/kdenlive.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kdenlive-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # Broken

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1b6e7c1317c299352a40a3f170e95f46d24936d30a8102f165bfe6ac94bb3c4fa0956122c09f0da6f43b08e0b12d00c9dd9b8b57936b3f2059a7caa7bb0d4d09  kdenlive-23.08.4.tar.xz
"
